import { createRouter, createWebHistory } from 'vue-router'
import Routes from './routes'

import Portal from '@/views/portal/index.vue'
import Login from '@/views/portal/login/index.vue'
import Register from '@/views/portal/register/index.vue'
import ResetPassword from '@/views/portal/reset_password/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: Routes.PORTAL,
      redirect: Routes.LOGIN,
      name: 'portal',
      component: Portal,
      children: [
        {
          path: Routes.LOGIN,
          name: 'login',
          component: Login
        },
        {
          path: Routes.REGISTER,
          name: 'register',
          component: Register
        },
        {
          path: Routes.RESET_PASSWORD,
          name: 'resetPassword',
          component: ResetPassword
        }
      ]
    }
  ]
})

export default router
